import time
import unittest
from HTMLTestRunner_PY3 import HTMLTestRunner

if __name__ == '__main__':
    case_dir= r'../test_case_baidu'
    discover=unittest.defaultTestLoader.discover(case_dir,pattern='test*.py')

    report_dir= r'../reports_baidu'
    now=time.strftime('%Y-%m-%d %H_%M_%S')
    report_name=rf'{report_dir}\{now}report.html'
    with open(report_name,mode='wb') as f:
        runner=HTMLTestRunner(f,title='测试报告',description='报告详情')
        runner.run(discover)
